package net.zcscloud.zhuohcun.zeco.dao;

import net.zcscloud.zhuohcun.zeco.common.dao.LogicDAO;
import net.zcscloud.zhuohcun.zeco.dto.AccesstokenDTO;
import net.zcscloud.zhuohcun.zeco.entity.Accesstoken;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;

import javax.transaction.Transactional;

public interface AccesstokenDao extends LogicDAO<Accesstoken, Long> {
    Accesstoken findByValid(String name);
    @Modifying
    @Transactional
    @Query("UPDATE Accesstoken SET valid = '0' WHERE valid = '1'")
    void setValid0();
    void save(AccesstokenDTO accesstokenDTO);
}